#ifndef _ARCHIVEVIEW_H
#define _ARCHIVEVIEW_H

#include <QWidget>

class QAction;
class QComboBox;
class QLineEdit;
class QListWidget;
class QTableWidget;
class QString;
class QListWidgetItem;
class QTabBar;

class ArchiveView:public QWidget
{
    Q_OBJECT
public:
    ArchiveView(QWidget *parent = 0);
    ~ArchiveView();

public slots:
  void addArchive();
  void addVideo(QString filename);
  void addImage(QString filename, QString videoFile, double pos);

  void changeViewType(int index);
  void selectItem(QListWidgetItem* current, QListWidgetItem* previous);
  void activeItem(QListWidgetItem* item);

  void deleteEntry();
  void moveEntry();
  void modifyEntry(int row, int column);

  void markStartTime(double cur);
  void markEndTime(double cur);

  void sort(bool checked);
  void changeSortField(int index);
  void refreshView();

  void promptArch(const QString& text);

signals:
  void openFile(QString& filename);

protected:

private:
  void setProperty(QString table, QString type, QString value);
  void refreshMainView(int index);
  void changeArchs(QString sortF, QString type, QString likeF, QString likeV);
  void changeVideos(QString sortF, QString type, QString likeF, QString likeV);
  void changeImages(QString sortF, QString type, QString likeF, QString likeV);

  QString m_curArch, m_curVideo;
  int m_bInitProperty;
  int m_iconSize;

  QAction* deleteAct, *sortAct, *moveToAct;
  QTabBar* viewType; 
  QComboBox *filterType, *sortField;
  QLineEdit *filter, *numArch;
  QListWidget* mainView;
  QTableWidget* property;
};
#endif
